import request from '@/utils/request'

// 发送消息
export function chat(data) {
    return request({
      url: '/liveRoom/liveRoom/chat',
      method: 'post',
      data:data
    })
}


// 获取直播间详情
export function getRoomInfo(id) {
  return request({
    url: '/liveRoom/liveRoom/getInfo?id='+id,
    method: 'get'
  })
}

// 开播
export function openPlay(data) {
  return request({
    url: '/liveRoom/liveRoom/openPlay',
    method: 'post',
    data:data
  })
}

/**
 * 
 * @returns 查询用户直播间信息
 */
export function getRoomUserInfo() {
  return request({
    url: '/liveRoom/liveRoom/getRoomUserInfo',
    method: 'get'
  })
}

/**
 * 
 * @returns 关播
 */
export function closePlay() {
  return request({
    url: '/liveRoom/liveRoom/closePlay',
    method: 'get'
  })
}

/**
 * 用户关注和取关直播间
 * @param {*} roomId 
 * @param {*} select 
 * @returns 
 */
export function updateCollect(roomId,select) {
  return request({
    url: '/liveRoom/liveRoom/updateCollect/'+roomId+'/'+select,
    method: 'get'
  })
}

/**
 * 用户查询关注列表
 * @returns 
 */
export function getRoomCollectList() {
  return request({
    url: '/liveRoom/liveRoom/getRoomCollectList',
    method: 'get'
  })
}


//查询直播间用户列表
export function getUserRoomList(id) {
  return request({
    url: '/sys/sysUser/getUserRoomList?id='+id,
    method: 'get'
  })
}